$(function(){
		
		$("#addArticleCategory").click(function(){
			var data = {"articleCategoryName":$("#articleCategoryAddName").val()};
			var url = 'saveArticleCategory.action';
			$.post(url,
				   data,
				   function(data){
				   	  if(data == "false"){
				   	  		$(".articleCategoryAddFeedBack").html("Already Exist !");
				   	  }else{
				   	  $(".articleCategoryAddFeedBack").html("It's Done !");
				   	  	setTimeout(function(){
				   	  		window.location = 'preArticleCategoryManager';
				   	  	},1500);
				   	  	
				   	  }	
			 	    },
				   'text'
			);
		});
		
		$("#updateArticleCategory").click(function(){
			var data = {"articleCategoryName":$("#articleCategoryUpdateName").val(),"articleCategoryId":$("#articleCategoryUpdateId").val()};
			var url = 'updateArticleCategory.action';
			$.post(url,
				   data,
				   function(data){
				   	  
				   	  $(".articleCategoryUpdateFeedBack").html(data);
				   	  setTimeout(function(){
				   	  		window.location = 'preArticleCategoryManager';
				   	  	},1500);
			 	    },
				   'text'
			);
		});
		
		$("#deleteArticleCategory").click(function(){
			var data = {"articleCategoryId":$("#articleCategoryDeleteId").val()};
			var url = 'deleteArticleCategory.action';
			$.post(url,
				   data,
				   function(data){
				   	  
				   	  $(".articleCategoryDeleteFeedBack").html(data);
				   	  setTimeout(function(){
				   	  		window.location = 'preArticleCategoryManager';
				   	  	},1500);
			 	    },
				   'text'
			);
		}); 
	});